﻿Public Class frmGraph

    Private WithEvents m_pGraph As clsChart

    Private Sub frmGraph_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        m_pGraph = New clsPieChart(300.0, 10.0)
        m_pGraph.GraphEntries.AddValue("Test1", 1.6)
        m_pGraph.GraphEntries.AddValue("Test2", 4.2)
        m_pGraph.GraphEntries.AddValue("Test3", 2.8)
        m_pGraph.GraphEntries.AddValue("Test1", 5.1)
    End Sub


    Private Sub m_pGraph_Graph_Refreshed(ByVal sender As clsChart) Handles m_pGraph.Graph_Refreshed
        Me.ClientSize = New Size(m_pGraph.GraphImage.Width, m_pGraph.GraphImage.Height)
        Me.Refresh()
    End Sub

    Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
        e.Graphics.DrawImageUnscaled(m_pGraph.GraphImage, New Point(0, 0))
        'MyBase.OnPaint(e)
    End Sub

End Class